package top.wfzzq.dp.decreate;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;

import org.omg.CORBA.PUBLIC_MEMBER;

/**
 * 修饰器模式（系统Io标配设计模式）
 * 
 * @author wanghui
 *
 */
public class Demo {
	public static void main(String[] args) {
//		Food food = new Rice();
//		food = new Meat(food);
//		food = new Egg(food);
//		System.out.println(food);
//		food = new Egg(new Meat(new Onion(new Noodle())));
//		System.out.println(food);
//		System.out.println("系统io============================");
//	  Scanner scanner=new Scanner(System.in);
//		InputStream is = new FileInputStream("修饰器模式演示.txt");
//		// InputStream is = new FileInputStream("修饰器模式演示.txt");
//		// byte[] bs=new byte[8*1024];
//		// is.read(b);
//		// 文本输入流，构造的时候必须传入被修饰的主题入流
//		InputStreamReader reader = new InputStreamReader(is);
//		// 现在可以完成字符输入流
//		// char[] chars = new char[8 * 1024];
//		// reader.read(chars);
//		// 二次修饰，将char刘变成字符串输入流
//		BufferedReader br = new BufferedReader(reader);
//		String line = br.readLine();
//		while (line != null) {
//			System.out.println("line");
//			line = br.readLine();
//		}
//		br.close();
//		reader.close();
//		is.close();
//
//		// 输出流的设计模式
//		PrintWriter writer = new PrintWriter(new FileOutputStream("demo.txt"));
//		writer.println("dfdfds");
//		writer.println();
//		writer.println("zhengzhiqiang");
//		writer.close();
	}
}
